package com.wzcl.app.model.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;


//用来搜索商品的类
@Data
public class FindCommodityDto extends BaseDto {

    @NotNull(message = "商品类型不能为空")
    @ApiModelProperty(value = "商品类型")
    private Integer type;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "难度")
    private Integer hard;

    @ApiModelProperty(name = "年级")
    private Integer gradeId;

    @ApiModelProperty(value = "科目")
    private Integer subjectId;

    @ApiModelProperty(value = "课程类型")
    private Integer courseType;

    @ApiModelProperty(value = "物品类型")
    private Integer materialType;

    public CourseDto getCourseDto(){
        CourseDto courseDto = new CourseDto();
        courseDto.setIsCommodity(true);
        //course的属性
        courseDto.setId(id);
        courseDto.setName(name);
        courseDto.setHard(hard);
        courseDto.setGradeId(gradeId);
        courseDto.setSubjectId(subjectId);
        courseDto.setCourseType(courseType);
        courseDto.setPageSize(pageSize);
        courseDto.setPageNumber(pageNumber);
        return courseDto;
    }

    public MaterialDto getMaterialDto(){
        MaterialDto materialDto = new MaterialDto();
        materialDto.setIsCommodity(true);
        //material属性
        materialDto.setId(id);
        materialDto.setName(name);
        materialDto.setType(materialType);
        materialDto.setPageSize(pageSize);
        materialDto.setPageNumber(pageNumber);
        return materialDto;
    }

}
